<template>
  <div>
    <button @click="sendParams">传递</button>
    <h1>{{msg}}</h1>
  </div>
</template>
<script>
  export default {
    name: '',
    data () {
      return {
        msg: '这是第一个页面数据1传过来',
        msg2: '这是第一个页面数据2传过来'
      }
    },
    methods: {
      sendParams () {
        this.$router.push({
          path: '/page2',
          name: 'page2',
          query: {
            name: '页面1',
            data:this.msg,
            data2:this.msg2
          }
          /*query: {
              name: 'name',
              dataObj: this.msg
          }*/
        })
      }
    },
    computed: {

    },
    mounted () {

    }
  }
</script>
<style scoped>

</style>
